(function (G) {
    G.vue({
        data: {
            LIST_count:3,
            selectIndex: 0,
            userId:'',
            APIURL:G.Storage.get('APIURL'),
            status: ['待处理', '已处理'],
            actionFiles:''
        },
        methods: {
            changeActive(e){
                let selectIndex = e.currentTarget.dataset.index
                this.setData({LIST_index:selectIndex})
            },
            buildList(type){
                let userId = G.Storage.get('userInfo').userId
                return G.list({ 
                    dataFormat(row){
                        row.actionFile = row.actionFiles.split(',')[0]
                        row.createTime = row.time || G.date(row.createTime).Format('yyyy-MM-dd')
                    },
                    get:{url:'/api/model/warning_system',data:{status:type,userId:userId}}
                })
            },
            // data-url="/pages/care/writeProblemFeedback/index"  
            go(){
                wx.navigateTo({
                  url: '/pages/care/writeProblemFeedback/index',
                })
            },
            onShow(){
                this.LIST_init([
                    this.buildList(2),
                    this.buildList(1)
                ])
                this.LIST_loads()
            },
            detail(e){
                let index = e.currentTarget.dataset.index
                wx.navigateTo({
                  url: '/pages/care/problemDetail/index?index='+index,
                })
            }
        },
        created() {
            this.LIST_init([
               this.buildList(2),
               this.buildList(1)
            ])
            this.LIST_loads()
        }
    })
})(wx.$)